import React from 'react';
import { BrowserRouter as Router, Redirect, Route, NavLink, Switch } from 'react-router-dom';
import Mytab from './Mytab.js'
import Login from './Mymsg/Login.js'
import Zhuce from './Mymsg/Zhuce.js'

import Home from './Home/Home.js'
import Add from './Add/Add.js'
import Article from './Article/Article.js'
import Mymsg from './Mymsg/Mymsg.js'
import Mymsgsetnamesig from './Mymsg/Mymsgsetnamesig.js'
import Changename from './Mymsg/Changename.js'
import Changesig from './Mymsg/Changesig.js'
import Changepic from './Mymsg/Changepic.js'

import Myshoucang from './Mymsg/Myshoucang.js'
import Mybook from './Mymsg/Mybook.js'
import Myactivity from './Mymsg/Myactivity.js'
import Myset from './Mymsg/Myset.js'
import Mymysuibi from './Mymsg/Mymysuibi.js'
import Mymywen from './Mymsg/Mymywen.js'
import Mymyguan from './Mymsg/Mymyguan.js'
import Mymyfen from './Mymsg/Mymyfen.js'
import Bookdetail from './Mymsg/Bookdetail.js'

import Activity from './Article/Activity.js'
import Lunbotu from './Article/Lunbotu.js'
import Artlist from './Article/Artlist.js'
import Detail from './Article/Detail.js'

import Essay from './Add/Essay';
import Notes from './Add/Notes.js';
import Notemsg from './Home/Notemsg';

import PersonalPage from './Home/PersonalPage.js';

class App extends React.Component {
 
    constructor(props) {
        super(props);
        this.state = {
  		  
  	  };
    }
    componentDidMount() {
		//console.log(123789);
    }
		
    render () {
		return (
        <Router>
      		<Switch>
			
				<Route exact path="/Login" component={Login}/>
				<Route exact path="/Zhuce" component={Zhuce}/>
				
      		    <Route exact path="/Add" component={Add}/>
				<Route exact path="/Article" component={Article}/>
				<Route exact path="/Mymsg" component={Mymsg}/>
				<Route exact path="/Home" component={Home}/>
				<Route exact path="/Mymsgsetnamesig" component={Mymsgsetnamesig}/>
				<Route exact path="/Changename" component={Changename}/>
				<Route exact path="/Changesig" component={Changesig}/>
				<Route exact path="/Changepic" component={Changepic}/>
<<<<<<< HEAD
=======
				
>>>>>>> 429ee6d905019f594144cf938b04d544385572a3
				
				<Route exact path="/Activity/:id" component={Activity}/>
				<Route exact path="/Artlist" component={Artlist}/>
				<Route exact path="/Lunbotu" component={Lunbotu}/>
				<Route exact path="/Detail/:id" component={Detail}/>

				<Route exact path="/Myshoucang" component={Myshoucang}/>
				<Route exact path="/Mybook" component={Mybook}/>
				<Route exact path="/Myactivity" component={Myactivity}/>
				<Route exact path="/Myset" component={Myset}/>
				<Route exact path="/Mymysuibi" component={Mymysuibi}/>
				<Route exact path="/Mymywen" component={Mymywen}/>
				<Route exact path="/Mymyguan" component={Mymyguan}/>
				<Route exact path="/Mymyfen" component={Mymyfen}/>
				<Route exact path="/Bookdetail" component={Bookdetail}/>
				
				<Route path='/Essay' component={Essay}/>
				<Route path='/Notes' component={Notes}/>
				
				<Route path='/notemsg/:id' component={Notemsg}/>
				<Route path='/Personal' component={PersonalPage}/>
				
      		    <Route render={()=><Redirect to='/Login' />}/>
      		</Switch>
      			
      		<Mytab />
      	</Router>
    );
  }
}
export default App;
// const App = () => {
//     return <Provider store={store}>
//         <Router>
//         <Switch>
//             <Route exact path="/" component={}/>
//             <Route render={()=><Redirect to='/'/>}/>
//         </Switch>
//         <Mytab />
//     </Router>
// </Provider>
// }
	// <div >
	// 	<button onClick={this.userlistcha}>根据id查userlist用户信息</button><br />
	// 	<button onClick={this.userlistchaall}>查所有</button><br />
	// 	<button onClick={this.userlistchaid}>根据name查userlist id</button><br /><br />
		
	// 	<button onClick={this.userlistgaipic}>根据id 改用户pic</button><br />
	// 	<button onClick={this.userlistgainame}>根据id 改用户name</button><br />
	// 	<button onClick={this.userlistgaisig}>根据id 改用户signature</button><br /><br />
		
	// 	<button onClick={this.userlistzeng}>增用户</button><br />
	// 	<div id="container"></div>
 //      </div>
	  
	  



  //    userlistzeng() {
  //   		console.log('userlistzeng');
  //   		fetch('http://62.234.30.197:8088/userlist/zeng', {
  //   			method: 'post',
  //   			body: JSON.stringify({'name':'增加的','pic':'zheshi pic','password':'zheshi password'}),
  //   			headers: {
  //   			    "Access-Control-Allow-Origin":"*",
  //   			    'content-type': 'application/json'
  //   			},
  //   			mode: 'cors'
  //   		})
  //   		.then(res=>res.json())
  //   		.then(res=> {
  //   			console.log(res)
  //   		})
  //   	}
		// userlistshan() {
		// 	console.log('shan 3');
		// 	fetch('http://62.234.30.197:8088/userlist/shan', {
		// 		method: 'post',
		// 		body: JSON.stringify({'userid':'11'}),
		// 		headers: {
		// 		    "Access-Control-Allow-Origin":"*",
		// 		    'content-type': 'application/json'
		// 		},
		// 		mode: 'cors'
		// 	})
		// 	.then(res=>res.json())
		// 	.then(res=> {console.log(res)})
		// }
		// userlistcha() {
		// 	console.log('userlistcha');
		// 	fetch('http://62.234.30.197:8088/userlist/cha', {
		// 		method: 'post',
		// 		body: JSON.stringify({'userid':'2'}),
		// 		headers: {
		// 		    "Access-Control-Allow-Origin":"*",
		// 		    'content-type': 'application/json'
		// 		},
		// 		mode: 'cors'
		// 	})
		// 	.then(res=>res.json())
		// 	.then(res=> {
		// 		console.log(res)
		// 		var _html = ``;
		// 		res.forEach( (item) => {
		// 			_html += `<span>name:  ${item.name}</span><br />`;
		// 		} );
		// 		//$("#container").html( _html );
		// 		document.getElementById('container').innerHTML = _html;
		// 	})
		// }
		// userlistchaid() {
		// 	console.log('userlistchaid');
		// 	fetch('http://62.234.30.197:8088/userlist/chaid', {
		// 		method: 'post',
		// 		body: JSON.stringify({'name':'蔡孟婷'}),
		// 		headers: {
		// 		    "Access-Control-Allow-Origin":"*",
		// 		    'content-type': 'application/json'
		// 		},
		// 		mode: 'cors'
		// 	})
		// 	.then(res=>res.json())
		// 	.then(res=> {
		// 		console.log(res)
		// 	})
		// }
		// userlistchaall() {
		// 	console.log('userlistchaid');
		// 	fetch('http://62.234.30.197:8088/userlist/chaall', {
		// 		method: 'post',
		// 		headers: {
		// 		    "Access-Control-Allow-Origin":"*",
		// 		    'content-type': 'application/json'
		// 		},
		// 		mode: 'cors'
		// 	})
		// 	.then(res=>res.json())
		// 	.then(res=> {
		// 		console.log(res)
		// 		var _html = ``;
		// 		res.forEach( (item) => {
		// 			_html += `<span>name:  ${item.name}</span><br />`;
		// 		} );
		// 		//$("#container").html( _html );
		// 		document.getElementById('container').innerHTML = _html;
		// 	})
		// }
		// 	userlistgaipic() {
		// 		console.log('gai cheng wangyibo');
		// 		fetch('http://62.234.30.197:8088/userlist/gaipic', {
		// 			method: 'post',
		// 			body: JSON.stringify({'userid':'2','pic':'新的pic'}),
		// 			headers: {
		// 			    "Access-Control-Allow-Origin":"*",
		// 			    'content-type': 'application/json'
		// 			},
		// 			mode: 'cors'
		// 		})
		// 		.then(res=>res.json())
		// 		.then(res=> {console.log(res)})
		// 	}
		// 	userlistgainame() {
		// 		console.log('gai cheng wangyibo');
		// 		fetch('http://62.234.30.197:8088/userlist/gainame', {
		// 			method: 'post',
		// 			body: JSON.stringify({'userid':'2','name':'新的name'}),
		// 			headers: {
		// 			    "Access-Control-Allow-Origin":"*",
		// 			    'content-type': 'application/json'
		// 			},
		// 			mode: 'cors'
		// 		})
		// 		.then(res=>res.json())
		// 		.then(res=> {console.log(res)})
		// 	}
		// 	userlistgaisig() {
		// 		console.log('gai sig');
		// 		fetch('http://62.234.30.197:8088/userlist/gaisig', {
		// 			method: 'post',
		// 			body: JSON.stringify({'userid':'2','signature':'新的signature'}),
		// 			headers: {
		// 			    "Access-Control-Allow-Origin":"*",
		// 			    'content-type': 'application/json'
		// 			},
		// 			mode: 'cors'
		// 		})
		// 		.then(res=>res.json())
		// 		.then(res=> {console.log(res)})
		// 	}